package com.yunxiao.cloud.web.task;

import com.yunxiao.cloud.common.util.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @description: GetTimeTask
 * @author: yunxiao
 * @date: 2020/1/13 14:10
 * @version: V1.0
 **/
@Component("getTimeTestTask")
public class GetTimeTask implements TaskService {

    private static final Logger logger = LoggerFactory.getLogger(GetTimeTask.class.getName());

    private SimpleDateFormat format =
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Override
    public void run(String params) {
        logger.info("Params === >> " + params);
        logger.info("getTimeTestTask当前时间::::" + format.format(new Date()));
        logger.info("getTimeTestTask当前时间::::" + DateUtil.format(new Date(), DateUtil.DATE_TIME_FORMAT_PATTERN));
    }
}
